package com.ycc.usercenter.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ycc.usercenter.model.domain.User;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author HP
* @description 针对表【user】的数据库操作Service
* @createDate 2024-06-19 18:16:41
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账户
     * @param userPassword 用户密码
     * @param checkPassword 检查密码
     * @return 大于1成功
     */
    long userRegister(String userAccount,String userPassword,String checkPassword);

    /**
     * 用户登录
     */
    User userLogin(String userAccount, String userPassword, HttpServletRequest request);

    User getSafetyUser(User originUser);

    /**
     *
     * 用户退出登录
     * @param request
     * @return
     */
    Integer userLogout(HttpServletRequest request);

    /**
     * 根据标签查询用户
     * @param tagNameList 标签集合
     * @return
     */
    List<User> searchUsersByTags(List<String> tagNameList);

    /**
     * 获取登录用户
     * @param request 请求对象
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 更新用户信息
     * @param user 用户信息
     * @param loginUser 登录用户
     * @return
     */
    int updateUser(User user, User loginUser);

    boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User loginUser);
}
